import instance from "./axiosinstance"

export function reqAddAdv(formData) {
  return instance.post("/addAdv", formData, {
    headers: {
      "content-type": "multipart/form-data",
    },
  })
}

export function reqVerifyToken() {
  const authorization = localStorage.getItem("authorization")
  return instance.post("/verifyAdmin", { authorization })
}

export function getAdvs() {
  return instance.get("/findAdvs")
}

export function delAdv(id) {
  return instance.post("/deleteAdv", { id })
}

export function getOneAdv(id) {
  return instance.get("/findOneAdv?id=" + id)
}

export function updateAdv(formData) {
  return instance.post("/updateAdv", formData, {
    headers: {
      "content-type": "multipart/form-data",
    },
  })
}